//
//  WYBasedViewController.m
//  WYModel
//
//  Created by ios on 2017/3/2.
//  Copyright © 2017年 Wy. All rights reserved.
//

#import "WYBasedViewController.h"
#import "WYNavigationController.h"

@interface WYBasedViewController ()

@end

@implementation WYBasedViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self resetNav];
    self.view.backgroundColor   = WYCOLOR(240, 240, 240, 1);
    
    if (self.navigationController && self != self.navigationController.viewControllers.firstObject){
        [self resetNaviWithTitle:@""];
    }
}

/**
 自定义导航栏
 */
-(void)resetNav{
    
    
}

-(void)enterLoginUI{
    
    
}

-(void)resetNaviWithTitle:(NSString *)title{
    
    UIButton *leftBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [leftBtn setBackgroundImage:[UIImage imageNamed:@"backbutton_icon3"] forState:UIControlStateNormal];
    leftBtn.frame = CGRectMake(0, 0, 30, 30);
    [leftBtn addTarget:self action:@selector(backBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:leftBtn];
}

- (void)backBtnClick{
    [self.navigationController popViewControllerAnimated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
